// Hang Man Game TurboIRC Script // By Chourdakis Michael © 1998 int Size = GetInt("Word","Size",0,".\\HGWORD.INI") string Given = strupr("$4") string ToShow = "" string Z = "" string mL = "" int F = 0 string KrZ = "" int LP = 0 int Found = 0 if (strnicmp("$3*",":!letter ",8)== 0) goto LetterChoice endif if (strnicmp("$3*",":!word ",6)== 0) goto WordChoice endif // no relative text return :WordChoice string VW = strupr("$4") if (VW==GuessWord) /display $channel ConGraTuLaTiOnS you found the SecReT Word was %GuessWord% ! /display $channel *******GAME OVER******* /destroystaticvariable GuessWord /destroystaticvariable HangTries /_event HANGMANGAME 0 0 0 * return else /display $channel BooHaHa It is NOT that word ! HangTries += 1 goto NotFound endif :LetterChoice // in a game ! // $4 has the letter // Is it found in the GuessWord ? if (FindStringPos(GuessWord,Given)==-1) // NOT FOUND !!! /display $channel BooHaHa Letter %Given% is NOT in the hidden word ! HangTries += 1 goto NotFound else // FOUND ! goto FoundLetter endif :NotFound if (HangTries == 10) /display $channel UHHHOH you didn't find the SecReT Word was %GuessWord% ! /display $channel *******GAME OVER******* /destroystaticvariable GuessWord /destroystaticvariable HangTries /_event HANGMANGAME 0 0 0 * return else int V = 10 - HangTries /display $channel WaTcH It You have OnLy %V% tries left ! endif goto ShowWordStatus :FoundLetter /display $channel WoW Letter %Given% is found in the hidden word ! for (LP = 0 ; LP < Size ; LP += 1) if (strncmp(GuessWord + LP,Given,1) == 0) // it is in place Z = sprintf("Letter%i",LP) SetString("Word",Z,"1",".\\HGWORD.INI") endif endfor :ShowWordStatus Found = 0 for (LP = 0 ; LP < Size ; LP += 1) KrZ = sprintf("Letter%i",LP) mL = GetString("Word",KrZ,"0",".\\HGWORD.INI") F = atoi(mL) if (F == 0) ToShow = strcat(ToShow,"_ ") Found = 1 else ToShow = strncat(ToShow,GuessWord + LP,1) ToShow = strcat(ToShow," ") endif endfor /display $channel Word Status : %ToShow% if (Found == 0) // found ALL ! /display $channel ConGraTuLaTiOnS you found the SecReT Word was %GuessWord% ! /display $channel *******GAME OVER******* /destroystaticvariable GuessWord /destroystaticvariable HangTries /_event HANGMANGAME 0 0 0 * endif